package com.huahua.api.repository;

import com.huahua.api.entity.pojo.TtsRecord;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * @author Huahua-Ai
 * @date 2025-01-10 14:40:00
 * @description TTS记录数据访问层
 */
@Repository
public interface TtsRecordRepository extends ReactiveCrudRepository<TtsRecord, Long> {

    /**
     * 根据状态查询记录
     */
    Flux<TtsRecord> findByStatus(String status);

    /**
     * 根据状态查询记录并按创建时间排序
     */
    Flux<TtsRecord> findByStatusOrderByCreatedTimeAsc(String status);

    /**
     * 根据ID和状态查询
     */
    Mono<TtsRecord> findByIdAndStatus(Long id, String status);
}
